package se.webbzon.boltzmann.launcher;

import java.util.Arrays;

import se.webbzon.boltzmann.GameApplication;
import se.webbzon.boltzmann.bootstrap.BoltzmannBootstrap;
import se.webbzon.boltzmann.debug.Debug;
import se.webbzon.oschi01.bootstrap.BootstrapApplication;
import se.webbzon.oschi01.bootstrap.BootstrapException;
import se.webbzon.oschi01.bootstrap.Bootstrapper;
import se.webbzon.oschi01.bootstrap.j3d.J3DBootstrap;

public class Launcher {
	
	public static void main(String[] args) {
		
		Bootstrapper bootstrapper = new BoltzmannBootstrap();
		BootstrapApplication app;
		try {
			app = bootstrapper.bootstrap(new GameApplication());
			app.run(args);
		} catch (BootstrapException e) {
			// Try to run without JInput
			bootstrapper = new J3DBootstrap();
			try {
				app = bootstrapper.bootstrap(new GameApplication());
				String[] args2 = Arrays.copyOf(args, args.length+1);
				args2[args2.length-1] = "-nojinput";
				app.run(args2);
			} catch (BootstrapException e2) {
				Debug.report(e2);
			}
		}
		
		
	}

}
